<template>
  <div id="changeClass_manage" class="container">
    <div class="content">
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item class="title" :to="{ path: '/processing_center/comprehensive' }">办理中心首页</el-breadcrumb-item>
        <el-breadcrumb-item class="title">转班</el-breadcrumb-item>
      </el-breadcrumb>
      <div class="panel">
        <div class="condition">
          <div class="row_one">
            <el-select
              style="width:2.03rem;float: left;margin-left:.1rem;"
              clearable
              v-model="tabledisplayObj.courseId"
              placeholder="请选择学年"
            >
              <el-option
                v-for="item in selectCourseList"
                :key="item.value"
                :label="item.name"
                :value="item.value"
              ></el-option>
            </el-select>

            <el-input
              style="width: 3rem;margin-left:.1rem;"
              placeholder="搜索 学员姓名\手机号\监护人"
              v-model="tabledisplayObj.studentName"
              class="input_search"
              clearable
            ></el-input>
            <div @click="searchCoupon()" class="search_btn" style="margin-left:0.1rem;">搜索</div>
            <div class="right_btn" @click="changeClass_add">转班</div>
          </div>
        </div>
        <div>
          <table class="table" cellspacing="0">
            <thead class="thead">
              <tr>
                <td style="width: 1rem;">序号</td>
                <td style="width: 3rem;">学员姓名</td>
                <td style="width: 3rem;">原班级</td>
                <td style="width: 3rem;">转入班级</td>
                <td style="width: 3rem;">办理时间</td>
                <td style="width: 5rem;">备注</td>
                <td style="width: 3rem;">办理人</td>
                <td style="width: 3rem;">操作</td>
              </tr>
            </thead>
            <tbody class="tbody">
              <tr>
                <td>1</td>
                <td>舒语汐</td>
                <td>小(一)班 托儿班</td>
                <td>小(二)班 托儿班</td>
                <td>2019-12-30</td>
                <td>
                  <div
                    style="line-height: 0.52rem;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 1;overflow: hidden;"
                  >小孩子太厉害了，得上大学，小学是扭到小时，哈哈哈哈哈哈哈哈哈哈哈哈哈哈</div>
                </td>
                <td>舒亮</td>
                <td>
                  <span class="operate_btn" style="color:#67C23A;">查看</span>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
        <el-pagination
          class="page"
          layout="total, sizes, prev, pager, next, jumper"
          :current-page="tabledisplayObj.currPage"
          @size-change="pageSizeChange"
          @current-change="tabledisplayChangePage"
          :total="tabledisplayObj.total"
        ></el-pagination>
        <el-dialog
          class="commonDialog"
          :modal="false"
          :close-on-click-modal="commonDialog.clickmodal"
          :title="commonDialog.title"
          :visible.sync="commonDialog.visible"
          v-loading.fullscreen.lock="commonDialog.loading"
          element-loading-background="rgba(0, 0, 0, 0.1)"
        >
          <div class="changeClass">
            <div class="txt">选择转班学员</div>
            <div class="rowbox">
              <el-input
                class="inputtxt"
                style="font-size:0.16rem;"
                placeholder="请输入关键字"
                v-model="commonDialog.searchText"
                clearable
                ref="searchText"
              ></el-input>
              <el-button class="resetElement" type="primary" @click="searchData">查询</el-button>
            </div>
            <template>
              <el-table
                :data="commonDialog.tableData"
                border
                max-height="240"
                style="width: 100%;font-size:0.16rem;"
                class="table"
                highlight-current-row
                @current-change="currentChange"
              >
                <el-table-column prop="student" label="学员"></el-table-column>
                <el-table-column prop="age" label="年龄"></el-table-column>
                <el-table-column prop="phone" label="电话"></el-table-column>
              </el-table>
            </template>
            <div class="rowbox bottom">
              <el-button class="resetElement" type="primary" @click="closeCommonDialog">取消</el-button>
              <el-button class="resetElement" type="primary" @click="changeClassBtnClick">转班</el-button>
            </div>
          </div>
        </el-dialog>
        <changeClassAdd ref="changeClassAdd" @callback="closeAdd"></changeClassAdd>
      </div>
    </div>
  </div>
</template>

<script>
let vm;
let user;
import changeClassAdd from "./common/change_class_add";
export default {
  data() {
    return {
      tabledisplayObj: {
        currPage: 1,
        pageSize: 10,
        total: 0,
        studentName: "",
        courseId: ""
      },
      commonDialog: {
        title: "转班",
        clickmodal: false,
        loading: false,
        visible: false,
        searchText: "",
        tableData: []
      },
      selectCourseList: [],
      changeClassDataList: [] //转班学员列表
    };
  },
  components: { changeClassAdd },
  methods: {
    /**取消转班 */
    closeCommonDialog() {
      vm.commonDialog = {
        title: "转班",
        clickmodal: false,
        loading: false,
        visible: false,
        searchText: "",
        tableData: []
      };
    },
    /**点击转班 */
    changeClassBtnClick() {
      vm.commonDialog.visible = false;
      vm.$refs.changeClassAdd.init({});
    },
    /**新增学员 */
    addStudent() {},
    /**筛选学员 */
    searchData() {},
    /**选中学员回调 */
    currentChange() {},
    /**新增转班回调 */
    closeAdd() {},
    /**新增转班 */
    changeClass_add() {
      vm.commonDialog.visible = true;
    },
    /**
     * 初始化数据
     */
    initData() {
      this.getData(vm.tabledisplayObj);
    },
    /**
     * 抽取出来获取列表
     */
    getData(paras) {},
    pageSizeChange: function(val) {
      //页条数发生改变
      vm.tabledisplayObj.pageSize = val;
      vm.initData();
    },
    /**表格显示形式翻页 */
    tabledisplayChangePage(val) {
      vm.tabledisplayObj.currPage = val;
      vm.initData();
    },
    /**
     * 搜索
     */
    searchCoupon() {
      vm.tabledisplayObj.currPage = 1;
      vm.initData();
    }
  },
  mounted() {
    vm = this;
    user = tool.getItem(lsKey.user, true); //得到当前用户信息
    //获取数据字典
    let dicdata = tool.getItem(lsKey.dict, true);
    this.initData();
  }
};
</script>

<style lang="scss">
#changeClass_manage {
  .commonDialog {
    z-index: 30 !important;
    top: 0.81rem !important;
    left: 2.1rem !important;
    background-color: rgba(0, 0, 0, 0.5) !important;

    .el-dialog {
      width: 8.55rem !important;

      .el-dialog__title {
        font-size: 0.22rem !important;
        color: #333333 !important;
      }
    }

    .changeClass {
      padding: 0 0.2rem 0 0.2rem;
    }

    .changeClass {
      .el-table {
        max-height: 2.4rem !important;

        .el-table__body-wrapper {
          max-height: 1.92rem !important;
        }
      }
    }

    .changeClass {
      .el-table__body tr.current-row > td {
        background-color: #5eabf9;
      }

      .el-button {
        margin: 0.1rem;
        // width: 1rem;
      }

      .txt {
        font-size: 0.16rem;
      }

      .rowbox.bottom {
        display: flex;
        justify-content: center;

        .btn {
          margin: 0.1rem 0.5rem;
        }
      }

      .inputtxt {
        width: 2.5rem;
        margin: 0.1rem;
        margin-left: 0;
      }
    }
  }
  .el-input__inner {
    border-radius: 0.08rem;
    font-size: 0.16rem;
    color: #666666;
    height: 0.36rem;
    line-height: 0.36rem;
  }
  .el-input__icon {
    line-height: 0.36rem;
  }

  .input_search {
    .el-input__inner {
      background-color: rgb(247, 248, 250);
    }
  }
  .el-breadcrumb__separator {
    color: #999999;
  }
  .el-breadcrumb__inner.is-link {
    font-weight: 400;
    color: #141414;
  }
  .el-breadcrumb__inner.is-link:hover {
    color: #3885f8;
  }
  .el-breadcrumb__item:last-child .el-breadcrumb__inner {
    color: #999999;
  }
  .right_btn {
    background-image: url(~@/assets/img/clue_manage/add_white.png);
    width: 1.54rem;
  }
}
</style>
<style scoped src="@/style/module/table.css"></style>
<style scoped src="@/style/clue_manage/clue_manage.css"></style>